package com.employ.admin.service;

import com.employ.admin.common.Result;
import com.employ.admin.entity.News;
import com.employ.admin.mapper.NewsMapper;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;

@Component
@Service
public class NewsService {

    @Resource
    NewsMapper newsMapper;
    public Result<?> insert(@RequestBody News news){
        newsMapper.insert(news);

        System.out.println("插入news成功");
        return Result.success();
    }


    public Result<?> updateById(@RequestBody News news){
        newsMapper.updateById(news);

        System.out.println("更新news成功");
        return Result.success();
    }

}
